import sevoes from "@/util/Http";
import Qs from "qs";
function categoryInquire(data) {
  //查询
  return sevoes({
    method: "get",
    params: {
      _gp: "admin.category",
      _mt: "queryCategory",
      ...data,
    },
  });
}

function tree(data) {
  //Spu树
  return sevoes({
    method: "get",
    params: {
      _gp: "admin.category",
      _mt: "categorySecondLevelTree",
      ...data,
    },
  });
}

function addCategory(data) {
  //添加
  return sevoes({
    method: "post",
    data: Qs.stringify({
      _gp: "admin.category",
      _mt: "addCategory",
      ...data,
    }),
  });
}

function updateCategory(data) {
  //添加
  return sevoes({
    method: "post",
    data: Qs.stringify({
      _gp: "admin.category",
      _mt: "updateCategory",
      ...data,
    }),
  });
}

function deleteCategory(data) {
  //删除
  return sevoes({
    method: "post",
    data: Qs.stringify({
      _gp: "admin.category",
      _mt: "deleteCategory",
      ...data,
    }),
  });
}

export default { categoryInquire, tree, addCategory,updateCategory, deleteCategory };
